package com.sunqianhu.design_patterns_23.behavioral.memento;

public class TextEditor {
    private String content;
    public TextEditor(String content) {
        this.content = content;
    }
    public String getContent() {
        return content;
    }
    public void setContent(String content) {
        this.content = content;
    }

    public Memento createMemento() {
        return new Memento(content);
    }
    public void restoreFromMemento(Memento memento) {
        this.content = memento.getState();
    }
}
